package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusCustomerContactMapper;
import com.ruoyi.business.domain.BusCustomerContact;
import com.ruoyi.business.service.IBusCustomerContactService;

/**
 * 客户联系人Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class BusCustomerContactServiceImpl implements IBusCustomerContactService 
{
    @Autowired
    private BusCustomerContactMapper busCustomerContactMapper;

    /**
     * 查询客户联系人
     * 
     * @param contactId 客户联系人主键
     * @return 客户联系人
     */
    @Override
    public BusCustomerContact selectBusCustomerContactByContactId(Long contactId)
    {
        return busCustomerContactMapper.selectBusCustomerContactByContactId(contactId);
    }

    /**
     * 查询客户联系人列表
     * 
     * @param busCustomerContact 客户联系人
     * @return 客户联系人
     */
    @Override
    public List<BusCustomerContact> selectBusCustomerContactList(BusCustomerContact busCustomerContact)
    {
        return busCustomerContactMapper.selectBusCustomerContactList(busCustomerContact);
    }

    /**
     * 新增客户联系人
     * 
     * @param busCustomerContact 客户联系人
     * @return 结果
     */
    @Override
    public int insertBusCustomerContact(BusCustomerContact busCustomerContact)
    {
        busCustomerContact.setCreateTime(DateUtils.getNowDate());
        return busCustomerContactMapper.insertBusCustomerContact(busCustomerContact);
    }

    /**
     * 修改客户联系人
     * 
     * @param busCustomerContact 客户联系人
     * @return 结果
     */
    @Override
    public int updateBusCustomerContact(BusCustomerContact busCustomerContact)
    {
        busCustomerContact.setUpdateTime(DateUtils.getNowDate());
        return busCustomerContactMapper.updateBusCustomerContact(busCustomerContact);
    }

    /**
     * 批量删除客户联系人
     * 
     * @param contactIds 需要删除的客户联系人主键
     * @return 结果
     */
    @Override
    public int deleteBusCustomerContactByContactIds(Long[] contactIds)
    {
        return busCustomerContactMapper.deleteBusCustomerContactByContactIds(contactIds);
    }

    /**
     * 删除客户联系人信息
     * 
     * @param contactId 客户联系人主键
     * @return 结果
     */
    @Override
    public int deleteBusCustomerContactByContactId(Long contactId)
    {
        return busCustomerContactMapper.deleteBusCustomerContactByContactId(contactId);
    }
}
